<template>
    <page-body>
        <view class="page">
            <view class="flex align-stretch benben-position-layout flex ptEvaluate_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex align-center justify-between flex-sub ptEvaluate_fd0_0'>
                    <view class='flex align-center ptEvaluate_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  ptEvaluate_fd0_0_c0_c0'>&#xE794;</text>
                    </view>
                    <text class='ptEvaluate_fd0_0_c1'>评价</text>
                    <view class='flex align-center ptEvaluate_fd0_0_c0'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout ptEvaluate_flex_1">
                <view class='flex flex-wrap align-center ptEvaluate_fd1_0'>
                    <image class='ptEvaluate_fd1_0_c0' mode="aspectFill" :src='detail.avatar'></image>
                    <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                        <text class='ptEvaluate_fd1_0_c1_c0'>配送员：{{detail.name || detail.rider_name}}</text>
                        <text class='ptEvaluate_fd1_0_c1_c1'>{{time}}左右送达</text>
                    </view>
                </view>
                <view class='flex flex-wrap align-center ptEvaluate_fd1_0' v-if="rider_send_star">
                    <text class='ptEvaluate_fd1_1_c0'>配送评分</text>
                    <view class='flex flex-wrap align-center'>
                        <template v-for="starNum in [1,2,3,4,5]">
                            <image v-if="rider_send_star >= starNum" :key="starNum" class='ptEvaluate_star1fd1_1_c1' mode="aspectFit" :src='STATIC_URL+"63.png"'></image>
                            <image v-else :key="starNum" class='ptEvaluate_star1fd1_1_c1' mode="aspectFit" :src='STATIC_URL+"62.png"'></image>
                        </template>
                    </view>
                </view>
				<view class='flex flex-wrap align-center ptEvaluate_fd1_0' v-if="!rider_send_star">
				    <text class='ptEvaluate_fd1_1_c0'>配送评分</text>
				    <view class='flex flex-wrap align-center'>
				        <template v-for="starNum in [1,2,3,4,5]">
				            <image @click="fd1_1_c1 = starNum" v-if="fd1_1_c1 >= starNum" :key="starNum" class='ptEvaluate_star1fd1_1_c1' mode="aspectFit" :src='STATIC_URL+"63.png"'></image>
				            <image @click="fd1_1_c1 = starNum" v-else :key="starNum" class='ptEvaluate_star1fd1_1_c1' mode="aspectFit" :src='STATIC_URL+"62.png"'></image>
				        </template>
				    </view>
				</view>
                <view class='flex flex-wrap align-center' v-if="!rider_send_star">
                    <benben-flex-switch-new class-name='flex flex ptEvaluate_fd1_2_c0' v-model="select" :disabled='false' :auto='true'>
                        <template v-slot:checked>

                            <view class='flex flex position-relative align-center'>
                                <image class='ptEvaluate_checkfd1_2_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                            </view>

                        </template>
                        <template v-slot:unchecked>

                            <view class='flex flex position-relative justify-end align-center'>
                                <image class='ptEvaluate_checkfd1_2_c0_c0_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
                            </view>

                        </template>
                    </benben-flex-switch-new>
                    <text class='ptEvaluate_fd1_2_c1'>匿名提交</text>
                </view>
            </view>

            <!---flex布局flex布局结束-->
            <view class="flex flex-wrap align-start justify-center benben-position-layout flex ptEvaluate_flex_2" v-if="!rider_send_star">
                <button class='ptEvaluate_fd2_0' @tap.stop="tijiaoFunc">提交</button>

            </view>
            <view :style="{height: '120rpx'}"></view>


        </view>
    </page-body>
</template>
<script>
    import {
        validate
    } from '@/common/utils/validate.js'

    export default {
        components: {},


        data() {
            return {
                "fd1_1_c1": 5,
                "select": false,
                "detail": {
                    "aid": ""
                },
                "niming": false,
                "aid": "",
                "user_id": "",
                "time": "",
				postTtype:false,
				rider_send_star:'',
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {
            let {
                aid,
                user_id,
                time,
				rider_send_star
            } = options
            if (aid !== undefined) this.aid = aid
            if (user_id !== undefined) this.user_id = user_id
            if (time !== undefined) this.time = time
            // if (type !== undefined) this.type = type
			if(rider_send_star){
				this.rider_send_star = rider_send_star
			}
        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {
            this.getra6715d041d518Func()
        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
            //用户端/师傅端-查询评价页面骑手头部信息
            async getra6715d041d518Func() {
                //请求方法
                //数据验证

                let datadetail = await this.$api.get(global.apiUrls.post66715d041d518, {
                    rider_id: this.user_id
                });

                if (datadetail.data.code != 1) {
                    this.$message.info(datadetail.data.msg);
                    return
                }
                let infodetail = datadetail.data;
                this.detail = infodetail.data

            },
            //提交
            async tijiaoFunc() {
                //请求方法
                //数据验证
				if(this.postTtype){
					return
				}
				this.postTtype = true
                let data667157c63e7af = await this.$api.post(global.apiUrls.post667157c63e7af, {
                    orderinfo_id: this.aid,
                    rider_send_star: this.fd1_1_c1,
                    is_anony: this.select ? 1 : '0'
                });

                if (data667157c63e7af.data.code != 1) {
                    this.$message.info(data667157c63e7af.data.msg);
					this.postTtype = false
                    return
                }
                let info667157c63e7af = data667157c63e7af.data;


                setTimeout(() => {
                    this.$urouter.navigateBack(1);
                }, 500)
            }
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: #fff;
        background-size: 100% auto;
    }

    .ptEvaluate_flex_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .ptEvaluate_fd0_0_c1 {
        font-size: 36rpx;
        font-weight: 500;
        color: var(--benbenFontColor0);
    }

    .ptEvaluate_fd0_0_c0_c0 {
        font-size: 32rpx;
        font-weight: 500;
        color: #333;
    }

    .ptEvaluate_fd0_0_c0 {
        width: 180rpx;
        height: 88rpx;
    }

    .ptEvaluate_fd0_0 {
        padding: 0rpx 32rpx 0rpx 32rpx;
        height: 88rpx;
    }

    .ptEvaluate_flex_1 {
        padding: 32rpx 32rpx 0rpx 32rpx;
    }

    .ptEvaluate_fd1_2_c1 {
        color: #333333;
        font-size: 24rpx;
        font-weight: 400;
        line-height: 33rpx;
        text-align: left;
        font-style: normal;
    }

    .ptEvaluate_checkfd1_2_c0_c0_c0 {
        width: 32rpx;
        height: 32rpx;
    }

    ::v-deep .ptEvaluate_fd1_2_c0 {
        margin: 0rpx 16rpx 0rpx 0rpx;
    }

    .ptEvaluate_star1fd1_1_c1 {
        height: 32rpx;
        margin: 0rpx 10rpx 0rpx 0rpx;
        width: 32rpx;
    }

    .ptEvaluate_star1fd1_1_c1 {
        width: 32rpx;
        height: 32rpx;
        border-radius: 0rpx 0rpx 0rpx 0rpx;
        margin: 0rpx 10rpx 0rpx 0rpx;
    }

    .ptEvaluate_fd1_1_c0 {
        margin: 0rpx 32rpx 0rpx 0rpx;
        color: #333333;
        font-size: 28rpx;
        font-weight: 500;
        line-height: 40rpx;
    }

    .ptEvaluate_fd1_0_c1_c1 {
        color: #999999;
        font-size: 24rpx;
        font-weight: 400;
        line-height: 33rpx;
        text-align: left;
        font-style: normal;
    }

    .ptEvaluate_fd1_0_c1_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 600;
        line-height: 45rpx;
        margin: 0rpx 0rpx 8rpx 0rpx;
    }

    .ptEvaluate_fd1_0_c0 {
        width: 80rpx;
        height: 80rpx;
        border-radius: 80rpx;
        margin: 0rpx 24rpx 0rpx 0rpx;
    }

    .ptEvaluate_fd1_0 {
        margin: 0rpx 0rpx 40rpx 0rpx;
    }

    .ptEvaluate_flex_2 {
        width: 750rpx;
        height: 120rpx;
        overflow: hidden;
        z-index: 10;
        bottom: calc(0rpx + var(--window-bottom));
    }

    .ptEvaluate_fd2_0 {
        background: var(--benbenbgColor0);
        border-radius: 40rpx 40rpx 40rpx 40rpx;
        width: 654rpx;
        line-height: 80rpx;
        font-size: 28rpx;
        color: #fff;
        height: 80rpx;
    }
</style>